 <meta charset="utf-8">
 <div class="card" id="biz_SolutionConfigRecord_conatainer" style="padding-bottom: 0px;">
 
            <div class="card-body">
               <form id="searchForm" role="form" class="form-inline">
               	<div class="row" style="width: 100%">
					<div class="col-md-3">
	 	 			 	<div class="form-group row">
	                         <label for="name" class="col-md-4 col-form-label">所属解决方案</label>
	                         <div class="col-md-8">
	                                <input name="name"  v-model="searchForm.solutionId"  type="text" placeholder="" class="form-control">
	                           </div>
	                    </div>
 	  				</div>
					<div class="col-md-3">
	 	 			 	<div class="form-group row">
	                         <label for="name" class="col-md-4 col-form-label">配置设备</label>
	                         <div class="col-md-8">
	                                <input name="name"  v-model="searchForm.deviceId"  type="text" placeholder="" class="form-control">
	                           </div>
	                    </div>
 	  				</div>
					<div class="col-md-3">
	 	 			 	<div class="form-group row">
	                         <label for="name" class="col-md-4 col-form-label">状态D_#0未推送，1未确认，2已确认，3放弃#</label>
	                         <div class="col-md-8">
	                                <input name="name"  v-model="searchForm.status"  type="text" placeholder="" class="form-control">
	                           </div>
	                    </div>
 	  				</div>
 	  				
 	  				<div class="col-md-3">
 	 			 
	 	 			 	<div class="form-group row">
			                  <label class="col-md-4 col-form-label" >状态 </label>
			                  <div class="col-md-8">
					                   <select v-model="searchForm.status"  class="form-control" style="min-width: 150px;"   >
					                    <option  value="">请选择</option>
									    <option  value="1">正常</option>
									    <option value="0">禁用</option>
									  </select>
							    </div>
		                	</div>
                    
 	  				</div>
 	  				
 	  				
 	  					<div class="col-md-3">
 	 			 
	 	 			 	   <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-kperms="{perm:''}" v-on:click="search">
		                   <i class="ti-search" aria-hidden="true"></i>
		                   <strong>查询</strong></button>
                    
 	  				</div>
 	  				
 	 		 </div>
        </form>
   </div>
   
 <div class="card">
 	<div class="card-body">
 	<div class="row">
 	  <div class="col-md-12">
              	        <div class="btn-group " id="SolutionConfigRecordToolbar"  role="toolbar">
                                    <button type="button" v-kperms="{perm:''}"  class="btn btn-info" v-on:click="add">
                                        <i class="ti-plus" aria-hidden="true"></i> 添加
                                    </button>
                                    
                                     <button type="button"  v-kperms="{perm:''}" class="btn btn-info" v-on:click="edit">
                                        <i class="ti-pencil" aria-hidden="true"></i> 修改
                                    </button>
                                    
                                     <button type="button"  v-kperms="{perm:''}" class="btn btn-info" v-on:click="setEnable(1)">
                                        <i class="ti-check" aria-hidden="true"></i> 启用
                                    </button>
                                     <button type="button"  v-kperms="{perm:''}" class="btn btn-info" v-on:click="setEnable(0)">
                                        <i class="ti-power-off" aria-hidden="true"></i> 禁用
                                    </button>
                           </div>                   
           <table id="SolutionConfigRecordBootstrapTable" data-mobile-responsive="true" class="table-bordered"></table>
 	  </div>
 	</div>
 	</div>
 	</div>
 	
 </div>
<script>
new Vue({  
	  el: '#biz_SolutionConfigRecord_conatainer', 
	  data:{
		  searchForm:{
			  status: null,
			 solutionId: null,
			 deviceId: null,
			 status: null,
		  },
	      bus:new Vue()
	  },
	  mounted:function(){
		 var _this=this;
		
		 
		 _this.initTable();
	  },

    methods: {
  	  initTable: function(){
  		 var　_this=this;
  		  var columns=[
  				{checkbox:true,width:16},
					{ field: 'solutionId' , title: '所属解决方案' , width: 100},
					{ field: 'deviceId' , title: '配置设备' , width: 100},
					{field: 'status', title: '状态D_#0未推送，1未确认，2已确认，3放弃#', width: 100, formatter: _this.formatStatus},
					{ field: 'retryTimes' , title: '重试次数' , width: 100},
					];
  		  
  		  var url="/xzy/solutionConfigRecord/loadSolutionConfigRecordDataSet";
    		zfesBstable.laodJsonTable($("#SolutionConfigRecordBootstrapTable"),$("#searchForm"),$("#SolutionConfigRecordCateTableToolbar"),url,columns,_this.searchForm,
    				{showRefresh:false,showToggle:false,showColumns:false});
  	  },
      formatStatus: function(value, row, index ){
    	  if(0==value){
    		  return '<span class="btn btn-sm btn-warning">禁用</span>';
    	 }if(1==value){
    		  return '<span class="btn btn-sm btn-success">正常</span>';
    	 }else{return value;}
	  }, 
  	  search:function(){
  		  zfesBstable.reload($("#SolutionConfigRecordBootstrapTable")); 
  	  },
  	  refresh:function(){
  		  zfesBstable.refresh($("#SolutionConfigRecordBootstrapTable"));
  	  },
  	add: function(){
 		 var　_this=this;
 		 var url="/view/solutionConfigRecord/solutionConfigRecord.add.html";
 		 zfesLayerEditDg.open(url,{},"编辑",460,function(){_this.initTable();});
 		 
 	  },
 	  edit: function(id){
 		 var　_this=this;
 		 if(zfesBstable.isOneRow($("#SolutionConfigRecordBootstrapTable"))){
   			  var _this=this;
   			  var id=zfesBstable.getRowId($("#SolutionConfigRecordBootstrapTable"));
   			  var url="/view/solutionConfigRecord/solutionConfigRecord.edit.html";
   			  zfesLayerEditDg.open(url,{"id":id},"编辑",460,function(){_this.refresh();}); 
   		 }
 	  },
 	 doDelete: function(){
 		if(zfesBstable.isOneRow($("#SolutionConfigRecordBootstrapTable"))){
			  var _this=this;
				var id=zfesBstable.getRowId($("#SolutionConfigRecordBootstrapTable"));
				 alertSwal.confirm("删除","是否删除该数据",function(){
					    var ajaxUrl = "/xzy/solutionConfigRecord/deleteSolutionConfigRecord";
						zfesAjax.ajaxTodo(ajaxUrl, { "id" : id}, function(data) {
							alertSwal.successText(data.message);
							_this.refresh();
						},function(data){
							
						}); 
			});
		}
 		
	},
	
	  setEnable: function(status){
		  if(zfesBstable.isOneRow($("#SolutionConfigRecordBootstrapTable"))){
			  var id=zfesBstable.getRowId($("#SolutionConfigRecordBootstrapTable"));
			  var _this=this;
				 alertSwal.confirm("状态设置","是否执行该操作",function(){
					    var ajaxUrl = "/xzy/solutionConfigRecord/setSolutionConfigRecordStatus";
					    zfesAjax.ajaxTodo(ajaxUrl, { "id" : id,"status":status}, function(data) {
							alertSwal.successText(data.message);
							_this.refresh();
						});
					});
		  }
	  }
   	
   }

});

</script>


